package com.cz.basetool;

import android.content.Context;
import android.util.Log;
import android.widget.Toast;

/**
 * Created by XinYi on 2018/6/11.
 */

public class LogUtil {
    private static final String TAG = "LogUtil";
    private static boolean isDebug = true;

    public static void d(String mes) {
        if (isDebug) {
            Log.d(TAG, mes);
        }
    }

    public static void d(String TAG,String mes) {
        if (isDebug) {
            Log.d(TAG, mes);
        }
    }

    public static void dt(Context context, String TAG, String mes) {
        if (isDebug) {
            Log.d(TAG, mes);
            Toast.makeText(context, mes, Toast.LENGTH_SHORT).show();
        }
    }


    public static void e(String mes) {
        if (isDebug) {
            Log.e(TAG, mes);
        }
    }

    public static void e(String TAG,String mes) {
        if (isDebug) {
            Log.e(TAG, mes);
        }
    }

    public static void et(Context context,String TAG,String mes) {
        if (isDebug) {
            Log.e(TAG, mes);
            Toast.makeText(context, mes, Toast.LENGTH_SHORT).show();
        }
    }

}
